package org.smart.access.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Builder;
import com.baomidou.mybatisplus.annotation.Version;
import java.time.LocalDateTime;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.AllArgsConstructor;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.NoArgsConstructor;

/**
 * 用户表
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User {
    @TableId(value = "uid", type = IdType.ASSIGN_ID)
    private Long uid;
    /**
    * 所属房屋ID
    */
    private Long houseId;
    private String password;
    /**
    * 用户姓名
    */
    private String realname;
    private String phone;
    private Integer gender;
    /**
    * 居住性质
    */
    private String residentNature;
    private Integer role;
    /**
    * 状态  1:启用  0:禁用  2:注册待通过
    */
    private Integer status;
    @Version
    private Integer version;
    @TableField(condition = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(condition = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @TableLogic
    private Integer deleted;
}
